package avicit.bdp.dds.server.worker.task.sparkflow.utils;


public enum FlowState {
    STARTED("STARTED", "started"),
    COMPLETED("COMPLETED", "completed"),
    FAILED("FAILED", "failed"),
    ABORTED("ABORTED", "aborted"),
    FORK("FORK", "fork"),
    KILLED("KILLED", "killed");

    private final String value;
    private final String text;

    private FlowState(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public String getValue() {
        return value;
    }

    public static FlowState selectGender(String name) {
        for (FlowState portType : FlowState.values()) {
            if (name.equalsIgnoreCase(portType.name())) {
                return portType;
            }
        }
        return null;
    }
}
